package com.mpgame.core.effect;

import com.fasterxml.jackson.databind.JsonNode;
import com.mpgame.core.model.Monster;
import com.mpgame.core.utils.MReport;

public class ReinforceEffect extends Effect {
    private String type;
    private int level;
    @Override
    protected void innerParseJson(JsonNode params){
        this.type = params.get("type").asText();
        this.level = params.get("level").asInt();
    }
    @Override
    protected void take(Monster target){
        if(!target.reinforce(this.type, this.level)) System.out.println("强化效果作用失败：不存在的强化类型 " + this.type);
        else MReport.Report(target.getIdentifier() + "强化成功：" + this.type + this.level);
    }
}
